<!-- Slider轮播图 -->
<div class="swiper-container">
    <div class="swiper-wrapper">

        @for(banner in banners){
            <div class="swiper-slide"><a href="${banner.link}">
                <img src="${banner.img_src}"></a>
            </div>
        @}
    </div>
    <!-- 如果需要分页器 -->
    <div class="swiper-pagination"></div>

    <!-- 如果需要导航按钮 -->
    <div class="swiper-button-prev"></div>
    <div class="swiper-button-next"></div>
</div>

<script>
    var mySwiper = new Swiper ('.swiper-container', {
        direction: 'horizontal',
        loop: true,
        autoplay:true,

        // 如果需要分页器
        pagination: {
            el: '.swiper-pagination',
            type: 'progressbar',
        },
        // 如果需要前进后退按钮
        navigation: {
            nextEl: '.swiper-button-next',
            prevEl: '.swiper-button-prev',
        },

    })
</script>

<!-- /Slider轮播图 -->